/*
 * $Id: ProdiagsTaskParamsDAO.java,v 1.2 2009/07/10 15:18:36 navdeep_mahajan Exp $
 * 
 * Copyright (C) 2008 General Electric Company. All Rights Reserved.
 * 
 * This software is the confidential and proprietary information of the General
 * Electric Company (GE). You shall not disclose this software and shall use it
 * only in accordance with the terms of the license agreement you entered into
 * with GE.
 * 
 * GE MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF THE
 * SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
 * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR
 * NON-INFRINGEMENT. GE SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE
 * AS A RESULT OF USING, MODIFYING, OR DISTRIBUTING THIS SOFTWARE OR ITS
 * DERIVATIVES.
 */
package com.ge.healthcare.autosc.common.database.dao;

import java.util.ArrayList;
import java.util.List;

import org.springmodules.cache.annotations.Cacheable;

import com.ge.healthcare.autosc.common.ASCUtil;
import com.ge.healthcare.autosc.common.database.pojo.CfgProdiagsTaskParams;

public class ProdiagsTaskParamsDAO extends BaseDAO implements
		IProdiagsTaskParamsDAO {
	/**
	 * Eclispe generated
	 */
	private static final long serialVersionUID = 4704959684289793820L;

	private static final String TABLE_NAME = "com.ge.healthcare.autosc.common.database.pojo.CfgProdiagsTaskParams";

	private static final String COL_TASK_NAME = "taskName";

	public ProdiagsTaskParamsDAO() {
		super(TABLE_NAME);
	}

	@Cacheable(modelId = "ProdiagsTaskParamsDAOFlushModel")
	public List<CfgProdiagsTaskParams> getTaskParamsByTaskName(String taskName) {
		List<?> rtvdLogs = findByProperty(COL_TASK_NAME, taskName);
		if (!ASCUtil.isNullOrEmptyList(rtvdLogs)) {
			List<CfgProdiagsTaskParams> prodiagsTaskParams = new ArrayList<CfgProdiagsTaskParams>();
			for (int iCount = 0; iCount < rtvdLogs.size(); iCount++) {
				prodiagsTaskParams.add((CfgProdiagsTaskParams) rtvdLogs
						.get(iCount));
			}
			return prodiagsTaskParams;
		}
		return null;
	}

	/**
	 * @see com.ge.healthcare.autosc.common.database.dao.BaseDAO#save(java.lang.Object)
	 */
	public void save(Object pojo) {
		super.save(pojo);
	}

	/**
	 * @see com.ge.healthcare.autosc.common.database.dao.IRequestTypeDAO#saveAlways(java.lang.Object)
	 */
	public void saveAlways(Object pojo) {
		super.save(pojo);
	}

	/**
	 * @see com.ge.healthcare.autosc.common.database.dao.BaseDAO#deleteByID(java.lang.Object)
	 */
	public void deleteByID(Object pojo) {
		super.deleteByID(pojo);
	}

	/**
	 * @see com.ge.healthcare.autosc.common.database.dao.BaseDAO#refresh(java.lang.Object)
	 */
	public void refresh(Object pojo) {
		super.refresh(pojo);
	}
}
